//------------------------------------------
// T.Mock.Expectation
//------------------------------------------


T.Mock.Expectation = function( adaptee, method )
{
	this.method = method;
	this.expectation = adaptee.__expectations.last( );
};


T.Mock.Expectation.prototype =
{
	args: function( )
	{
		this.expectation.args = T.Mock.expectationArguments( this.method, Array( arguments ) );
		return this;
	},
	
	returns: function( value )
	{
		this.expectation.returns = value;
		return this;
	},
	
	calls: function( count )
	{
		this.expectation.calls = Lang.isNumber( count )  ? count : 1;
		return this;
	},
	
	error: function( error )
	{
		this.expectation.error = error;
		return this;
	},
	
	after: function( fRun )
	{
		this.expectation.fRun = fRun;
		return this;
	}
};